<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class UpdatePaneltplTypeIdToapppageAreasTables extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('apppage_areas', function (Blueprint $table) {
            if (Schema::hasColumn('apppage_areas', 'panteltpl_type_id')) {
                $table->dropColumn('panteltpl_type_id');
            }

            $table->integer('paneltpl_type_id')->default(0)->nullable()->unsigned()->comment('模板类型ID');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
